package main

import (
	"io/ioutil"

	"gopkg.in/yaml.v2"
)

type Header struct {
	Name         string `yaml:"name"`
	Cell         string `yaml:"cell"`
	OutputColumn string `yaml:"output_column"`
}

type Config struct {
	ExcelDirectory  string   `yaml:"excel_directory"`
	OutputDirectory string   `yaml:"output_directory"`
	Headers         []Header `yaml:"headers"`
}

func LoadConfig(filename string) (*Config, error) {
	data, err := ioutil.ReadFile(filename)
	if err != nil {
		return nil, err
	}
	var config Config
	err = yaml.Unmarshal(data, &config)
	return &config, err
}
